﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace CSharp.Libs.Misc
{
    public static class WelliHashGenerator
    {
        public static string GetHashForPW(string Password)
        {
            string salt = "uJJAZBjDDnhTY!96*5WgsBwLNWwiY6wt!%JlrY%pU/eDQFcRZ8OQiYHMrUu";
            SHA512 alg = SHA512.Create();
            byte[] result = alg.ComputeHash(Encoding.UTF8.GetBytes(salt + Password));
            return ByteArrayToString(result).ToLower();
        }

        private static string ByteArrayToString(byte[] ba)
        {
            string hex = BitConverter.ToString(ba);
            return hex.Replace("-", "");
        }
    }
}
